<style>
    .nav-tabs > li > a {
        border: 0;
        border-radius: 0;
    }

    .nav-tabs > li > a {
        margin-right: 2px;
        line-height: 1.42857143;
    }

    .nav > li > a {
        position: relative;
        display: block;
        padding: 10px 15px;
        color: #337ab7;
    }

    :after, :before {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
    }

    .nav:before, .nav:after {
        display: table;
        content: '';
    }

    .nav:after {
        clear: both;
    }

    .areabox {
        background: #fff;
        width: 430px;
    }

    .areabox .nav-tabs {
        padding: 0;
        margin: 0;
        -webkit-padding-start: 0px;
    }

    .areabox .tab-content {
        width: 408px;
        height: 210px;
        padding: 5px 0;
        margin-top: -1px;
    }

    .nav-tabs {
        border-bottom: 1px solid #ddd;
    }

    .nav-tabs > li {
        float: left;
        margin-bottom: -1px;
    }

    .nav > li {
        position: relative;
        display: block;
    }

    ul, li {
        list-style: none;
    }

    .tab-content > .tab-pane {
        display: none;
        visibility: hidden;
    }

    .tab-content > .active {
        display: block;
        visibility: visible;
    }

    .areabox .tab-content ul {
        padding: 0;
        margin: 0;
        -webkit-padding-start: 0px;
    }

    .popover {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1060;
        display: none;
        padding: 1px;
        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.42857143;
        text-align: left;
        white-space: normal;
        background-color: #fff;
        -webkit-background-clip: padding-box;
        background-clip: padding-box;
        border: 1px solid #ccc;
        border: 1px solid rgba(0, 0, 0, .2);
        border-radius: 6px;
        -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
        box-shadow: 0 5px 10px rgba(0, 0, 0, .2)
    }

    .popover.top {
        margin-top: -10px
    }

    .popover.right {
        margin-left: 10px
    }

    .popover.bottom {
        margin-top: 10px
    }

    .popover.left {
        margin-left: -10px
    }

    .popover-title {
        padding: 8px 14px;
        margin: 0;
        font-size: 14px;
        background-color: #f7f7f7;
        border-bottom: 1px solid #ebebeb;
        border-radius: 5px 5px 0 0
    }

    .popover-content {
        padding: 9px 14px
    }

    .popover > .arrow, .popover > .arrow:after {
        position: absolute;
        display: block;
        width: 0;
        height: 0;
        border-color: transparent;
        border-style: solid
    }

    .popover > .arrow {
        border-width: 11px
    }

    .popover > .arrow:after {
        content: "";
        border-width: 10px
    }

    .popover.top > .arrow {
        bottom: -11px;
        left: 50%;
        margin-left: -11px;
        border-top-color: #999;
        border-top-color: rgba(0, 0, 0, .25);
        border-bottom-width: 0
    }

    .popover.top > .arrow:after {
        bottom: 1px;
        margin-left: -10px;
        content: " ";
        border-top-color: #fff;
        border-bottom-width: 0
    }

    .popover.right > .arrow {
        top: 50%;
        left: -11px;
        margin-top: -11px;
        border-right-color: #999;
        border-right-color: rgba(0, 0, 0, .25);
        border-left-width: 0
    }

    .popover.right > .arrow:after {
        bottom: -10px;
        left: 1px;
        content: " ";
        border-right-color: #fff;
        border-left-width: 0
    }

    .popover.bottom > .arrow {
        top: -11px;
        left: 50%;
        margin-left: -11px;
        border-top-width: 0;
        border-bottom-color: #999;
        border-bottom-color: rgba(0, 0, 0, .25)
    }

    .popover.bottom > .arrow:after {
        top: 1px;
        margin-left: -10px;
        content: " ";
        border-top-width: 0;
        border-bottom-color: #fff
    }

    .popover.left > .arrow {
        top: 50%;
        right: -11px;
        margin-top: -11px;
        border-right-width: 0;
        border-left-color: #999;
        border-left-color: rgba(0, 0, 0, .25)
    }

    .popover.left > .arrow:after {
        right: 1px;
        bottom: -10px;
        content: " ";
        border-right-width: 0;
        border-left-color: #fff
    }

    .nav-tabs > li > a {
        border: 0;
        border-radius: 0;
    }

    .nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover {
        color: #fff;
        border: none;
        background-color: #FF7713
    }

    .popover {
        border-radius: 0;
        padding-top: 0;
        left: 0 !important;
    }

    .popover-title {
        border-radius: 0;
    }

    .popover.bottom > .arrow {
        left: 42px !important;
    }

    .popover.bottom > .arrow:after {
        border-bottom-color: #f7f7f7;
    }

    #tree_table {
        position: absolute;
        background: #fff;
        width: 100%;
        max-height: 200px;
        overflow: auto;
        border-bottom: 1px solid #d9d9d9;
        webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
        box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
    }

    .areabox .tab-content li.on {
        color: #FF7713;
        background: transparent;
    }

    .default_proj_label {
        background: orange;
        color: white;
        padding: 2px;
        border-radius: 2px;
        margin-left: 3px;
        display: inline-block;
    }
    i.point{background: url(http://img-dev.myscrmimg.cn/projects/qmyx/public/images/icon/point.png) no-repeat center;display: inline-block;width: 18px;height: 18px;}
</style>
<div ng-controller="projectInfoCtl">
    <div class="mt20">
        <div class="table-header clearfix" style="height: 20px;">
            <span class="bulidings-title">填写基本信息：</span>
            <p class="fr" style="color: #000;"><i class="point fl" style="margin-right: 10px;"></i><span class="fl">请及时完善项目初始楼盘信息、户型信息、房源信息，以便直销、微楼书等功能的引用。</span></p>
        </div>
        <form name="projectInfoForm">
            <table width="100%" class="mt15">
                <tr>
                    <td width="135" align="right" class="form-cell" valign="top"><span class="c-red">* </span>项目名称：</td>
                    <td class="cell-split-s">
                        <input type="text" ng-model="projectName" name="projectName" proj-name-allow  class="input-text fl mr10" value=""
                               style="width:400px" required>

                        <div ng-messages="projectInfoForm.projectName.$error"
                             ng-show="projectInfoForm.$submitted || projectInfoForm.projectName.$touched">
                            <p class="c-red lh30" ng-message="required">项目名称不能为空</p>
                            <p class="c-red lh30" ng-message="projNameAllow">项目名称重复</p>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="form-cell" valign="top"><span class="c-red">* </span>项目所在地：</td>
                    <td class="cell-split">
                        <div class="fl select mr10" style="width:400px;">
                        <span class="select-border js-select">
                        <input class="select-text" readonly="readonly" placeholder="选择所在地" data-label="项目所在地"
                               id="address" ng-model="address" type="text" value="" province="" city="" district=""
                               name="address" required/>
                        <span class="select-icon"><i class="select-icon-arrow"></i></span>
                            </span>
                        </div>
                        <div ng-messages="projectInfoForm.address.$error"
                             ng-show="projectInfoForm.$submitted || projectInfoForm.address.$touched">
                            <p class="c-red lh30" ng-message="required">项目所在地不能为空</p>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="form-cell" valign="top"><span class="c-red">* </span>所属公司：</td>
                    <td class="cell-split">
                        <div class="fl select mr10" style="width:400px;">
                            <span class="select-border js-select">
                                <input class="select-text" type="text" readonly
                                       name="belongsCompany_name"
                                       ng-click="toggleTreeCombo()"
                                       ng-model="belongsCompany.name"
                                       ng-disabled="curProjInfo.parentGUID" required/>
                                <span class="select-icon"><i class="select-icon-arrow"></i></span>
                            </span>

                            <div id="tree_table" ng-show="isTreeCollapse">加载中...</div>
                        </div>
                        <div ng-messages="projectInfoForm.belongsCompany_name.$error"
                             ng-show="projectInfoForm.$submitted || projectInfoForm.belongsCompany_name.$touched">
                            <p class="c-red lh30" ng-message="required">所属公司不能为空</p>
                        </div>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <div class="mt20">
        <div class="table-header clearfix" style="height: 20px;">
            <span class="bulidings-title">绑定项目：</span>
        </div>
        <div class="mt15 clearfix">
            <span class="lh30 fl text-indent">已绑定项目列表</span>

            <div class="fr btn-group">
                <button href="javascript:;"
                   ui-dialog="绑ERP项目"
                   ng-disabled="canEdit==0||!curProjectId||dialogHasShow"
                   ui-dialog-ok="bindERPProject()"
                   ui-dialog-before-show="beforeShowERPProject($dialog,$dialogScope)"
                   ui-dialog-url="inc/dialog/bind_erp.html"
                   class="btn permission p-0000200101-02-inline" ui-dialog="绑ERP项目">绑ERP项目</button>
            </div>
        </div>
        <div class="sheet">
            <table width="100%" class="mt5 jqtree-tree">
                <thead>
                <tr>
                    <th height="34">项目名称</th>
                    <th style="width:300px" ng-show="canEdit==1">操作</th>
                </tr>
                </thead>

                <tbody>
                <tr ng-repeat="item in bindErpList" ng-show="item.type!='delete'">
                    <td height="34">
                        {{item.Erp_ProjectName}}<span ng-show="item.DefaultProject==1"
                                                      class="default_proj_label">默认项目</span>
                    </td>
                    <td style="text-align: left;text-align: center;" ng-show="canEdit==1">
                        <a ng-show="item.DefaultProject!=1"  href="javascript:void(0)" title="设为默认"
                           ng-click="setDefault(item)" class="mr15 c-orange permission p-0000200101-02-inline">
                            设为默认
                        </a>
                        <a href="javascript:void(0)" title="取消项目"  ng-click="cancelBind(item)"  class="mr15 c-orange permission p-0000200101-02-inline">
                            取消项目
                        </a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <p class="mt15" style="background-color: #fff8ee;padding: 15px;">
            提示：如果绑定多个ERP项目，需要设置默认项目，用于云客数据向ERP同步时，存储到设置的默认ERP项目。</p>
    </div>
    <button href="javascript:;" class="fr mt15 btn permission p-0000200101-02-inline" ng-disabled="!curProjectId" ng-click="saveData(projectInfoForm.$valid)">保存</button>
</div>


